< previous page page_337 next page >

Page 337
    For Each prTemp In db.Properties
        strMsg = strMsg & prTemp.Name
        strMsg = strMsg & " = "
        strMsg = strMsg & prTemp.Value
        strMsg = strMsg & " {"
        strMsg = strMsg & ShowType(prTemp.Type) & "}"
        strMsg = strMsg & vbCrLf
    Next
    '
    MsgBox strMsg, vbInformation, "MakeUDP"
    '
    ' cleanup
    db.Close
    ws.Close
    Set db = Nothing
    Set ws = Nothing
    '
End Sub
The routine in Listing 9.13 adds two user-defined properties to the database. Notice that you attempt to delete the properties first. That way you can run this example several times without getting an error. Notice that you also used two different code structures to create the properties. Either one is correct.
Save and run the project. When you click the MakeUDP button, you should see a screen similar to Figure 9.12.
0337-01.jpg
Figure 9.12.
The results of the 
CreateProperty method.
The TableDef Data Object
The TableDef data object contains all the information needed to define a Base table object in the Database. You can access Base table objects using the OpenRecordset method. You use TableDef objects to create and maintain Base tables. TableDef objects have 3 collections, 5 methods, and 10 properties.

 
< previous page page_337 next page >

If you like this book, buy it!